package com.ruoyi.system.service.impl;

import java.util.HashMap;
import java.util.List;

import com.ruoyi.system.domain.SDictionary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.OverhaulStageMapper;
import com.ruoyi.system.domain.OverhaulStage;
import com.ruoyi.system.service.IOverhaulStageService;
import com.ruoyi.common.core.text.Convert;

/**
 * 大修阶段Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-10-29
 */
@Service
public class OverhaulStageServiceImpl implements IOverhaulStageService 
{
    @Autowired
    private OverhaulStageMapper overhaulStageMapper;

    /**
     * 查询大修阶段
     * 
     * @param id 大修阶段主键
     * @return 大修阶段
     */
    @Override
    public OverhaulStage selectOverhaulStageById(Long id)
    {
        return overhaulStageMapper.selectOverhaulStageById(id);
    }

    /**
     * 查询大修阶段列表
     * 
     * @param overhaulStage 大修阶段
     * @return 大修阶段
     */
    @Override
    public List<OverhaulStage> selectOverhaulStageList(OverhaulStage overhaulStage)
    {
        return overhaulStageMapper.selectOverhaulStageList(overhaulStage);
    }

    /**
     * 新增大修阶段
     * 
     * @param overhaulStage 大修阶段
     * @return 结果
     */
    @Override
    public int insertOverhaulStage(OverhaulStage overhaulStage)
    {
        return overhaulStageMapper.insertOverhaulStage(overhaulStage);
    }

    /**
     * 修改大修阶段
     * 
     * @param overhaulStage 大修阶段
     * @return 结果
     */
    @Override
    public int updateOverhaulStage(OverhaulStage overhaulStage)
    {
        return overhaulStageMapper.updateOverhaulStage(overhaulStage);
    }

    /**
     * 批量删除大修阶段
     * 
     * @param ids 需要删除的大修阶段主键
     * @return 结果
     */
    @Override
    public int deleteOverhaulStageByIds(String ids)
    {
        return overhaulStageMapper.deleteOverhaulStageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除大修阶段信息
     * 
     * @param id 大修阶段主键
     * @return 结果
     */
    @Override
    public int deleteOverhaulStageById(Long id)
    {
        return overhaulStageMapper.deleteOverhaulStageById(id);
    }

    @Override
    public void getAllByOverhaul(String current_overhaul, HashMap<String, Object> hs) {
        List<OverhaulStage> list = overhaulStageMapper.getAllByOverhaul(current_overhaul);
        hs.put("OverhaulStage", list);
        hs.put("code", 0);
    }

    @Override
    public List<OverhaulStage> getByOverhaul(String current_overhaul) {
        return overhaulStageMapper.getByOverhaul(current_overhaul);
    }
}
